
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 0797
 * @Author : WangRuoyu 
 * @Date : 2023/9/13 20:27
 */

#include "iostream"

using namespace std;

int add(int b[], int l, int r, int c) {
    b[l] += c;
    b[r + 1] -= c;
}

int main() {
    int n, k;
    scanf("%d %d", &n, &k);

    int a[n + 1];
    int b[n + 1];

    for (int i = 0; i <= n; ++i) {
        b[i] = 0;
    }

    for (int i = 0; i < n; ++i) {
        scanf("%d", &a[i]);
        add(b, i, i, a[i]);
    }

    while (k--) {
        int l, r, c;
        scanf("%d %d %d", &l, &r, &c);
        add(b, l - 1, r - 1, c);
    }

    a[0] = 0;
    for (int i = 0; i < n; ++i) {
        a[i + 1] = a[i] + b[i];
        printf("%d ", a[i + 1]);
    }

    return 0;
}